package com.data.JVM;

/**  测试虚拟机栈和本地栈的溢出
 * 、
 *  虚拟机参数：-Xss128k
 * Created by wangbing on 2018/5/31.
 */
public class JavaVMStackSOF {
    private int stackLength = 1;
    public void stackLeak(){
        stackLength++;
        stackLeak();
    }

    public static void main(String[] args) throws Throwable {
        JavaVMStackSOF sof = new JavaVMStackSOF();
        try {
            sof.stackLeak();
        } catch (Throwable e) {
            System.out.println("stackLength>>>>>>"+sof.stackLength);
//            throw e;
            e.printStackTrace();
        }
    }
}
